// 传一个链接返回链接对应的字典
function url_params_parse_obj(url_params) {

    var params = url_params.substring(1);

    var x = params.split("&");

    var access_token;
    var user_id;

    for (var i = 0; i < x.length; i++) {

        var ii = x[i].split('=')

        if (ii[0] == 'access_token') {
            access_token = ii[1]
        } else if (ii[0] == 'user_id') {
            user_id = ii[1]
        }

    }

    return { 'access_token': access_token, 'user_id': user_id }

}


// 点击叫车车的时候链接参数也发生变化
function changepcc() {
    var result = url_params_parse_obj(location.search)
    var pcc = document.getElementById('pcc');
    var url = '/static/user.html'
        + '?access_token='
        + result.access_token
        + '&user_id='
        + result.user_id;
    pcc.href = url;

}
// 点击拼车车的时候链接的参数不发生变化
function changejcc() {
    var result = url_params_parse_obj(location.search)
    var jcc = document.getElementById('jcc');
    var url = '/static/user.html'
        + '?access_token='
        + result.access_token
        + '&user_id='
        + result.user_id
        + '&jcc=1';
    jcc.href = url;

}


